import Vue from 'vue'
import i18n from '@/lang'
import 'normalize.css' // A modern alternative to CSS resets
// 下载  yarn add normalize.css  导入  import 'normalize.css'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
// import '@/directives'
import xxx from '@/directives/index2'
import componentJs from '@/components/lib/index.js'
Vue.use(componentJs)

import Print from 'vue-print-nb'
Vue.use(Print)

// 全局混入
// import ooo from '@/views/dashboard/mixin/index'
// Vue.mixin(ooo)

import mixinsJs from '@/mixins/index'
Vue.mixin(mixinsJs)

Vue.use(xxx)
// directives.js
// directives.vue
// directives/index.js
// directives/index.vue

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// process.env.NODE_ENV  === 'production/development'
// process.env.NODE_ENV:它是脚手架提供(vue-cli) production(生产)/development（开发）

// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})

Vue.config.productionTip = false
Vue.prototype.$bus = new Vue()
new Vue({
  el: '#app',
  i18n,
  router,
  store,
  data() {
    return {
      xxx: '99期'
    }
  },
  methods: {},
  render: (h) => h(App)
})
